package com.ctvit.common;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.lang3.StringUtils;

import com.ctvit.util.SessionHandlerImpl;

public class MySessionHandler extends SessionHandlerImpl {
	public  void processSession(String userId,String userName,HttpServletRequest req,HttpServletResponse resp){
		HttpSession sHttpSession=req.getSession(true);
		sHttpSession.setAttribute("userId", userId);
		sHttpSession.setAttribute("userName", userName);
	}
	public  boolean ifHaveSession(HttpServletRequest req){
		HttpSession sHttpSession=req.getSession(true);
		String s=(String)sHttpSession.getAttribute("userId");
		boolean ret=false;
		if (StringUtils.isEmpty(s)) ret=false;
		else{
			ret=true;
		}
		return ret;
	}
}
